/**
 * @description 
 * @author cq
 * @Date 2021-04-09 19:47:34
 * @LastEditTime 2021-04-12 11:21:08
 * @LastEditors cq
 */

// creators 
// {
//   add: () => ({ type: "ADD" }),
//     minus: () => ({ type: "MINUS" })
// }
function bindActionCreators(creators, dispatch) {
  for (const key in creators) {
    const fn = creators[key];
    // fn(dispatch)
    creators[key] = () => dispatch(fn())
  }
  return creators
}

export default bindActionCreators;